package com.bzg.autowire.genericType;

import com.bzg.spring.component.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@ComponentScan
@Configuration("condifg1")
public class Config {

//-----------------------------------------------------------------------------------
	// 能注入到OrderService<Config> user; 属性中
	@Bean
	public OrderService<Config> orderService1() {
		return new OrderService();
	}

	// 不能能注入到OrderService<Config> user; 属性中。java是无法获取本类上的泛型的，所以这里创建了一个OrderService<Config>对象，也没法拿到其泛型
	// 但方法返回类型的泛型可以拿到，所以这里该对象不满足注入
	@Bean
	public OrderService orderService2() {
		return new OrderService<Config>();
	}
//-----------------------------------------------------------------------------------

//	@Bean
	public List<Object> orderService1List() {
		return new ArrayList<>();
	}

//	@Bean
	public ExService<OrderService1,OrderService1> exService1() {
		return new ExService<>();
	}

}
